public class ExceptionTest {

    public void f() throws Error{
        throw new Error();
    }

    public static void main(String[] args){
        ExceptionTest a = new ExceptionTest();

        try {
            a.f();
        } catch (Throwable e) {
            System.out.println("catch");
//            throw new RuntimeException(e);
        }


//        try {
//            int[] arr = new int[10];
//            System.out.println(arr[10]);
//            System.out.println("no exception ");
//        }catch (ArrayIndexOutOfBoundsException a){
////        }catch ( Error a) {  //Error exception can't catch this error
////    }catch (Throwable a ){
//            System.out.println("catch ");
//        }finally {
//        System.out.println("finally ");
//        }
//
//        System.out.println("finally aaa");
    }


}
